﻿<%@ Page Title="" Language="C#" MasterPageFile="~/site.master" AutoEventWireup="true" CodeFile="Article.aspx.cs" Inherits="Article" Culture="auto" UICulture="auto" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <script type="text/javascript">
        $(function () {
            //品牌目录
            $(".categories_inner .column").each(function () {
                if ($(this).find("div").length == 0) {
                    $(this).remove();
                }
            });
            updateCategories()
            $(".categories_collapse").live("click", function () {
                var categories = $(".categories");
                var iconDown = '<%=ResolveUrl("~/images/categories_collapse_down.jpg") %>';
                var iconUp = '<%=ResolveUrl("~/images/categories_collapse_up.jpg") %>';

                if (categories.height() != 16) {
                    //                    categories.empty().animate({ height: 16 }).append('<a class="categories_collapse btn" style="bottom:0;"><img src="' + icon + '" /></a>');
                    categories.animate({ height: 16 }, function () {
                        $(this).find('.categories_collapse').find('img').attr({ src: iconDown });
                    });
                }
                else {
                    //                    if (Brands.UpdateBrands()) {
                    //                        __doPostBack('UpdatePanel1', '');
                    //                    }
                    categories.animate({ height: 140 }, function () {
                        $(this).find('.categories_collapse').find('img').attr({ src: iconUp });
                    });
                }
            });
        });

        //Updatepanel1 更新时重新调用carouFredSel jQuery插件
        function updateCategories() {
            $(".categories_inner").carouFredSel({
                width: 970,
                items: { visible: 5,
                    width: 190,
                    height: 140
                },
                auto: { pauseOnHover: "resume", duration: 700 },
                prev: { button: $(".categories_prev") },
                next: { button: $(".categories_next") }
            });
        }     
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnableScriptGlobalization="true" EnableScriptLocalization="true" AsyncPostBackTimeout="36000">
    </asp:ScriptManager>
    <!--品牌分类-->
    <div class="categories block">
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <ul class="categories_inner">
                    <li class="column">
                        <script type="text/javascript">
//                            Sys.Application.add_load(updateCategories);
                        </script>
                        <asp:Repeater ID="rptCategories" runat="server" OnItemCommand="rptCategories_ItemCommand">
                            <ItemTemplate>
                                <div>
                                    <asp:LinkButton ID="lbtnCategory" runat="server" CommandName="CATEGORY_CHANGE" CommandArgument='<%#Eval("BrandID").ToString()%>' Text='<%#HttpUtility.HtmlEncode(Eval("BrandName").ToString())%>'></asp:LinkButton></div>
                                <%# ((Container.ItemIndex+1) % 3 == 0 )? "</li><li class='column'>" :""%>
                            </ItemTemplate>
                        </asp:Repeater>
                    </li>
                </ul>
            </ContentTemplate>
        </asp:UpdatePanel>
        <a class="categories_prev btn"></a><a class="categories_next btn"></a><a class="categories_collapse btn">
            <img src='<%=ResolveUrl("~/images/categories_collapse_up.jpg") %>' />
        </a>
    </div>
    <div class="clearfix" style="margin-top:5px;">
        <div class="article_left">
            <div class="block b_202020 padding3 tc">
                <a href="http://weibo.com/seduceyy" target="_blank"><img src="images/weibo_sina2.jpg" /></a>
                <div class="article_categories block margin5_tb" style="padding-bottom:20px;">
                    <asp:UpdatePanel ID="UpdatePanel3" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                    <asp:Repeater ID="Repeater1" runat="server" 
                        onitemcommand="Repeater1_ItemCommand">
                        <ItemTemplate>
                            <div class="article_category">
                                <asp:LinkButton ID="lbtnTitle" runat="server" CommandName="Title_Change" CommandArgument='<%#Eval("ID").ToString() %>' ForeColor='<%#(!IsPostBack)?((Container.ItemIndex==0)? System.Drawing.Color.FromArgb(197, 147, 16):System.Drawing.Color.FromArgb(120, 120, 120)):System.Drawing.Color.FromArgb(120, 120, 120) %>'><%#Eval("TitleText").ToString() %></asp:LinkButton>
                            </div>
                        </ItemTemplate>
                    </asp:Repeater>
                    </ContentTemplate>
                    </asp:UpdatePanel>
                </div>
            </div>
            <div class="block margin5_tb">
            <asp:Repeater ID="rptAds" runat="server">
                <ItemTemplate>
                    <div class="rightbar_innerblock">
                        <a href='<%#ResolveUrl(Eval("Url").ToString()) %>' target="_blank">
                            <img src='<%#ResolveUrl(Eval("Image").ToString()) %>' width="100%" border="0" alt='<%#Eval("AdName").ToString() %>' /></a>
                    </div>
                </ItemTemplate>
            </asp:Repeater>
            </div>
        </div>
        <div class="article_right block b_202020 padding3">
            <div class="article_content block">
                <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                    <ContentTemplate>
                        <asp:Literal ID="literContent" runat="server"></asp:Literal>
                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="Repeater1" EventName="ItemCommand" />
                    </Triggers>
                </asp:UpdatePanel>
            </div>
        </div>
    </div>
</asp:Content>

